<template>
    <div class="">
        <el-dialog
                :title="title"
                :visible.sync="dialogFormVisible"
                width="55%"
                :close-on-click-modal="false"
                @close="close"
        >
          <div class="">
            <el-form ref="form" :model="form" label-width="120px">
              <div class="flex-bet flex-y-top">
                <div class="bflex-4">
                  <div class="shuju_title">
                    <div class="shuju_title_text">
                      <span>订单信息</span>
                    </div>
                  </div>
                  <div class="formBox">
                    <div class="flex pad_lr_10 bor_b_df5 lh40">
                      <div class="seeLeft">商品类型：</div>
                      <div>
                        <div v-if="orderDetail.goodsType=='1'"><el-tag type="success" size="mini">实物商品</el-tag></div>
                        <div v-if="orderDetail.goodsType=='2'"><el-tag size="mini">虚拟商品</el-tag></div>
                      </div>
                    </div>
                    <div class="flex pad_lr_10 bor_b_df5 lh40">
                      <div class="seeLeft">订单号：{{orderDetail.outTradeNo}}</div>
                      <div></div>
                    </div>
                    <div class="flex pad_lr_10 bor_b_df5 lh40">
                      <div class="seeLeft">取货方式：</div>
                      <div><span v-if="orderDetail.deliveryMode=='1'"><el-button type="primary" size="mini">快递配送</el-button></span><span
                          v-if="orderDetail.deliveryMode=='2'"><el-button type="success" size="mini">到店自提</el-button></span></div>
                    </div>
                    <div class="flex pad_lr_10 bor_b_df5 lh40">
                      <div class="seeLeft">提交时间：</div>
                      <div>{{ orderDetail.createdAt }}</div>
                    </div>
                    <div class="flex pad_lr_10 bor_b_df5 lh40">
                      <div class="seeLeft">用户信息：</div>
                      <div>{{ orderDetail.userName }}（UID：{{ orderDetail.userId }}）</div>
                    </div>
                    <div class="flex pad_lr_10 bor_b_df5 lh40">
                      <div class="seeLeft">订单状态：</div>
                      <div class="flex flex-center">
                        <div>
                          <div v-if="orderDetail.state=='2' && orderDetail.selfCode ==null"><el-tag type="danger" size="mini">待发货</el-tag></div>
                          <div v-if="orderDetail.state=='2' && orderDetail.selfCode !=null"><el-tag type="danger" size="mini">待核销</el-tag></div>
                          <div v-if="orderDetail.state=='3'"><el-tag size="mini">已发货</el-tag></div>
                          <div v-if="orderDetail.state=='4'"><el-tag type="success" size="mini">已完成</el-tag></div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="bflex-6 mar_l20">
                  <div class="shuju_title">
                    <div class="shuju_title_text">
                      <span>兑换详情</span>
                    </div>
                  </div>
                  <div class="formBox">
                    <div class="flex pad_lr_10 bor_b_df5 lh40">
                      <div class="seeLeft" v-if="orderDetail.deliveryMode=='2'">自提点联系人：{{orderDetail.receiveName}}/{{orderDetail.receiveTel}}</div>
                      <div class="seeLeft" v-if="orderDetail.deliveryMode=='1'">配送信息：{{orderDetail.receiveName}}/{{orderDetail.receiveTel}}</div>
                      <div></div>
                    </div>
                    <div class="flex pad_lr_10 bor_b_df5 lh40">
                      <div class="seeLeft" v-if="orderDetail.deliveryMode=='2'">自提点地址：</div>
                      <div class="seeLeft" v-if="orderDetail.deliveryMode=='1'">配送地址：</div>
                      <div class="">{{ orderDetail.receiveAddress }}</div>
                    </div>
                    <div class="flex pad_lr_10 bor_b_df5 lh40">
                      <div class="seeLeft" v-if="orderDetail.deliveryMode=='2'">核销码：</div>
                      <div class="">{{ orderDetail.selfCode }}</div>
                    </div>
                    <div class="flex pad_lr_10 bor_b_df5 lh40">
                      <div class="seeLeft">商品名称：</div>
                      <div class="">{{ orderDetail.goodsName }}</div>
                    </div>
                    <div class="flex pad_lr_10 bor_b_df5 lh40">
                      <div class="seeLeft">兑换价格：</div>
                      <div class=""> <div v-if="orderDetail.score>0 && orderDetail.money<=0">{{orderDetail.score}}积分</div>
                        <div v-if="orderDetailmoney>0 && orderDetail.score<=0">{{orderDetail.money}}元</div>
                        <div v-if="orderDetail.score>0 && orderDetail.money>0">{{orderDetail.score}}积分+{{orderDetail.money}}元
                        </div>
                      </div>
                    </div>
                    <div class="flex pad_lr_10 bor_b_df5 lh40">
                      <div class="seeLeft">兑换数量：x{{orderDetail.convertNum}}</div>
                      <div></div>
                    </div>
                  </div>
                </div>
              </div>
            </el-form>
          </div>
            <div slot="footer" class="dialog-footer">
                <el-button size="medium" @click="close">取 消</el-button>
                <el-button size="medium" type="primary" @click="save">确 定</el-button>
            </div>
        </el-dialog>
    </div>
</template>

<script>
    export default {
        name: "goodlistedit",
        created() {
        },
        data() {
            return {
                form: {
                    id:'',
                    sort: "1",
                    name: "",
                    min: "",
                    max: "",
                    minute: "",
                },
                orderDetail: {},
                title: "",
                type: 1,
                dialogFormVisible: false,
                qjjl:[],
                qjjl2:[],
            }
        },
        components: {
        },
        methods: {
            async showEdit(row) {
                if (!row) {
                    this.title = "添加";
                } else {
                    this.title = "预约记录";
                  // this.form = data
                    this.orderDetail = Object.assign({}, row);
                }
                this.dialogFormVisible = true;
            },
            close() {
                this.dialogFormVisible = false;
            },
            setStoreId(storeId){
              this.form.storeId = storeId
            },
            save() {
              this.dialogFormVisible = false;
            },
        }
    };
</script>
